SUBDIRS = bas sys net utl xli lnx

pkgincludedir = $(includedir)/xp

pkginclude_HEADERS = conf_msw.h conf_vms.h types.h macros.h pack1.h unpack.h

if ENABLE_CXX
pkginclude_HEADERS += \
	Exception.hpp \
	Named.hpp \
	RefCounted.hpp \
	Uncopyable.hpp \
	Hashable.hpp \
	Object.hpp \
	ScopedPtr.hpp
endif

CLEANFILES = *dist

install-data-hook:
	@echo "#ifndef _XP_CONFIG_H_" > "$(DESTDIR)$(pkgincludedir)/config.h"
	@echo "#define _XP_CONFIG_H_" >> "$(DESTDIR)$(pkgincludedir)/config.h"
	@$(EGREP) "#define[ ]+XP_" "$(top_builddir)/include/xp/config.h" >> "$(DESTDIR)$(pkgincludedir)/config.h"
	@echo "#endif" >> "$(DESTDIR)$(pkgincludedir)/config.h"
	@$(RM) -f "$(DESTDIR)$(pkgincludedir)/config.h.in"
	@$(SED) 's|/\*#define XPKIT_HAVE_CONFIG_H\*/|#define XPKIT_HAVE_CONFIG_H|' "$(srcdir)/types.h" > "$(DESTDIR)$(pkgincludedir)/types.h"


uninstall-hook:
	@$(RM) -f "$(DESTDIR)$(pkgincludedir)/config.h"
